From b04a72a5d85b0d7377b09d3dcbd376244fcf7dc8 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Mon, 9 Aug 2004 02:53:31 +0000 Subject: [PATCH] Don't stumble over separators which are not backed by model rows. Sun Aug 8 22:52:26 2004 Matthias Clasen * gtk/gtkcombobox.c (find_menu_by_path): Don't stumble over separators which are not backed by model rows. --- ChangeLog | 5 +++++ ChangeLog.pre-2-10 | 5 +++++ ChangeLog.pre-2-6 | 5 +++++ ChangeLog.pre-2-8 | 5 +++++ gtk/gtkcombobox.c | 9 +++++++-- 5 files changed, 27 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index e53ece0171..ba68a31ebe 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Sun Aug 8 22:52:26 2004 Matthias Clasen + + * gtk/gtkcombobox.c (find_menu_by_path): Don't stumble over + separators which are not backed by model rows. + Sun Aug 8 11:01:23 2004 Matthias Clasen * gtk/gtkcombobox.c (gtk_combo_box_set_active): Don't leak diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index e53ece0171..ba68a31ebe 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,8 @@ +Sun Aug 8 22:52:26 2004 Matthias Clasen + + * gtk/gtkcombobox.c (find_menu_by_path): Don't stumble over + separators which are not backed by model rows. + Sun Aug 8 11:01:23 2004 Matthias Clasen * gtk/gtkcombobox.c (gtk_combo_box_set_active): Don't leak diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index e53ece0171..ba68a31ebe 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,8 @@ +Sun Aug 8 22:52:26 2004 Matthias Clasen + + * gtk/gtkcombobox.c (find_menu_by_path): Don't stumble over + separators which are not backed by model rows. + Sun Aug 8 11:01:23 2004 Matthias Clasen * gtk/gtkcombobox.c (gtk_combo_box_set_active): Don't leak diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index e53ece0171..ba68a31ebe 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,8 @@ +Sun Aug 8 22:52:26 2004 Matthias Clasen + + * gtk/gtkcombobox.c (find_menu_by_path): Don't stumble over + separators which are not backed by model rows. + Sun Aug 8 11:01:23 2004 Matthias Clasen * gtk/gtkcombobox.c (gtk_combo_box_set_active): Don't leak diff --git a/gtk/gtkcombobox.c b/gtk/gtkcombobox.c index 1a58008ee6..535b32538c 100644 --- a/gtk/gtkcombobox.c +++ b/gtk/gtkcombobox.c @@ -2733,7 +2733,12 @@ find_menu_by_path (GtkWidget *menu, { if (GTK_IS_SEPARATOR_MENU_ITEM (i->data)) { - mpath = gtk_tree_path_copy (g_object_get_data (G_OBJECT (i->data), "gtk-combo-box-item-path")); + + mpath = g_object_get_data (G_OBJECT (i->data), "gtk-combo-box-item-path"); + if (!mpath) + continue; + + mpath = gtk_tree_path_copy (mpath); } else if (GTK_IS_CELL_VIEW (GTK_BIN (i->data)->child)) { @@ -4172,7 +4177,7 @@ gtk_combo_box_set_active (GtkComboBox *combo_box, if (index_ != -1) path = gtk_tree_path_new_from_indices (index_, -1); - + gtk_combo_box_set_active_internal (combo_box, path); if (path) -- 2.30.2